<!DOCTYPE html>
<html>
<#include "../head.html">
    <body class="full">
    <div class="mc">
        <div>
            <div class="mc-l">
                <!--左侧导航---{-->
                <div id="navPanelContainer">
                    <div class="system-logo cd"></div>
                    <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                        <!--管理员信息---}-->
                        <div class="nav-wrap">
                            <#include "left.html">
                        </div>
                </div>
                <!--左侧导航---}-->
            </div>
            <div class="mc-m">
                <div class="navToggle"></div>
            </div>
            <div class="mc-r">
                <!--顶部导航---{-->
                <#include "../topNav.html">
                    <!--顶部导航---}-->

                    <!--面包屑导航---{-->
                    <#assign moduleName="红包统计">
                        <#include "banner.html">
                            <!--面包屑导航---}-->

                            <!--工具栏--{-->
                            <div id="toolbar" class="clearfix">
                                <div class="s_toolTop">
                                    <div class="toolbor-module export">
                                        <input type="button" onclick="exportxls()" value="导出列表" class="input-button export-btn"/>
                                    </div>
                                    <div class="toolbor-module export">
                                        &nbsp;&nbsp;&nbsp;红包金额：${totalRedPacket!0}<br/>
                                        &nbsp;&nbsp;&nbsp;红包人数：${totalUser!0}
                                    </div>
                                </div>
                                <div class="s_toolTop">
                                    <div class="toolbor-module export">
                                        <div class="formTit">红包类型：</div>
                                        <div class="select-box" id="redPacketType">
                                            <div class="tag-select">全部</div>
                                            <ul class="tag-options">
                                                <li data-value="">全  部</li>
                                                <li data-value="01">充值</li>
                                                <li data-value="02">注册</li>
                                                <li data-value="03">认证</li>
                                                <li data-value="04">邀请</li>
                                                <li data-value="05">首次投标</li>
                                                <li data-value="51">拔得头筹</li>
                                                <li data-value="52">一锤定音</li>
                                                <li data-value="53">一马当先</li>
                                                <li data-value="54"><!--幸运之星-->天下无双</li>
                                                <li data-value="10">中秋宝箱</li>
                                                <li data-value="11">中秋状元</li>
                                                <li data-value="12">中秋榜眼</li>
                                                <li data-value="13">中秋探花</li>
                                                <li data-value="20">十一抢钱</li>
                                                <li data-value="30">奖励宝箱</li>
                                                <li data-value="31">活动宝箱</li>
                                                <li data-value="40">邀请奖励</li>
                                                <li data-value="55"><!--幸运女神1-->喜从天降</li>
                                                <li data-value="56">幸运女神2</li>
                                                <li data-value="32">活动抽奖</li>
                                                <li data-value="07">生日</li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="toolbor-module export" >
                                        <div class="formTit">是否使用：</div>
                                        <div class="select-box" id="status">
                                            <div class="tag-select">全部</div>
                                            <ul class="tag-options">
                                                <li data-value="">全  部</li>
                                                <li data-value="1">已使用</li>
                                                <li data-value="2">未使用</li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="toolbor-module export">
                                        <div class="formTit">用户名：</div>
                                        <input type="text" name="username" id="username" value="请输入用户名"  class="search-value">
                                    </div>
                                    <div class="toolbor-module export">
                                        <div class="formTit">真实姓名：</div>
                                        <input type="text" name="realname" id="realname" value="请输入真实姓名"  class="search-value">
                                    </div>
                                    <div class="toolbor-module export">
                                        <div class="formTit">使用时间：</div>
                                        <input class="_search-value" name="startDate" id="useStartDate" value="" onclick="change_picktime()" />
                                        <div class="formTit">到</div>
                                        <input class="_search-value" name="endDate" id="useEndDate" value="" onclick="change_picktime()" />
                                    </div>
                                </div>
                                <div class="s_toolTop">
                                    <div class="toolbor-module export">
                                        <div class="formTit">创建时间：</div>
                                        <input class="_search-value" name="startDate" id="createStartDate" value="" onclick="change_picktime()"/>
                                    </div>

                                    <div class="toolbor-module export">
                                        <div class="formTit">到期时间：</div>
                                        <input class="_search-value" name="startDate" id="validStartDate" value="" onclick="change_picktime()"/>
                                    </div>
                                </div>
                                <div class="s_toolTop">
                                    <div class="toolbor-module search">
                                        <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                                    </div>
                                </div>
                            </div>
                            <!--工具栏--}-->

                            <div id="main" class="clearfix">
                                <form action="" method="post">
                                    <table class="data-list">
                                        <tr class="header">
                                            <td>ID</td>
                                            <td>创建时间</td>
                                            <td>到期时间 </td>
                                            <td>用户名</td>
                                            <td>真实姓名</td>
                                            <td>红包金额</td>
                                            <td>红包类型</td>
                                            <td>使用比例</td>
                                            <td>期限限制</td>
                                            <td>是否使用</td>
                                            <td>使用时间</td>
                                        </tr>
                                            <#list list as item>
                                                <tr class="s">
                                                    <td>${item[0]?c}</td>
		                                            <td>${item[3]!''}</td>
		                                            <td>${item[4]!''}</td>
		                                            <td>${item[1]!''}</td>
		                                            <td>${item[2]!''}</td>
		                                            <td>${item[5]?c}元</td>
		                                            <td>                                            
		                                            <#if item[6]??&&item[6]=="01">充值
				                                    <#elseif item[6]=="02">注册
				                                    <#elseif item[6]=="03">认证
				                                    <#elseif item[6]=="04">邀请
				                                    <#elseif item[6]=="05">首次投标
				                                    <#elseif item[6] == "51">拔得头筹
													<#elseif item[6] == "52">一锤定音
													<#elseif item[6] == "53">一马当先
													<#elseif item[6] == "54">天下无双
													<#elseif item[6] == "10">中秋宝箱
													<#elseif item[6] == "11">中秋状元
													<#elseif item[6] == "12">中秋榜眼
													<#elseif item[6] == "13">中秋探花
													<#elseif item[6] == "20">十一抢钱
													<#elseif item[6] == "21">十一抢钱
													<#elseif item[6] == "22">十一抢钱
													<#elseif item[6] == "23">十一抢钱
													<#elseif item[6] == "30">奖励宝箱
													<#elseif item[6] == "31">活动宝箱
													<#elseif item[6] == "40">邀请奖励
													<#elseif item[6] == "55">喜从天降
													<#elseif item[6] == "56">幸运女神2
                                                    <#elseif item[6] == "32">活动抽奖
                                                    <#elseif item[6] == "07">生日
				                                    <#else>其他
				                                    </#if>
 
		                                            </td>
                                                    <td>${item[9]!''}%</td>
                                                    <td>${item[10]!''}天</td>
		                                            <#if item[7]??>
				                                    <td style="color:green;">已使用</td>
				                                    <#else>
				                                    <td>未使用</td>
				                                    </#if>
		                                            <!-- <td><a href="/admin/operate/viewRedPacketDetail.html?userId=${item[0]?c}">查看红包明细</a></td> -->
                                                	<td>${item[8]!''}</td>
                                                </tr>
                                            </#list>

                                    </table>
                                </form>

                                <!--底部工具栏--{-->
                                <div id="bottomToolbar" class="clearfix">
                                    <div class="other-tool">
                                        <dl class="refresh-data">
                                            <dt class="refresh-data-icon"></dt>
                                            <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                        </dl>
                                    </div>

                                    <!--翻页系统--{-->
                                    <div class="container s_formPage">
                                        <#import "../../common/page.html" as pager>
                                            <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                                    </div>
                                    <!--翻页系统--}-->
                                </div>
                                <!--底部工具栏--}-->

                                <script>
                                    var url = 'redPacketStatistics.html?search=true';
                                    var xlsurl='redPacketStatistics.html?type=export';
                                    function sousuo(){
                                    	 var sou = "";
                                         var username = $("#username").val();
                                         if (username!=null&&username!=""&&username!="undefine"&&username!="请输入用户名"){
                                             sou += "&username="+username;
                                         }
                                     	 var realname = $("#realname").val();
                     					 if(realname!=""&&realname!="请输入真实姓名"){
                     						sou += "&realname="+realname;
                     					 }
                     					 
                     					 var redPacketType = $("#redPacketType").find(".open-selected").attr("data-value");
                                         if(redPacketType!=null&&redPacketType!=""&&redPacketType!="undefine"){
                                         	sou += "&redPacketType="+redPacketType;
                                         } 
                                         var status = $("#status").find(".open-selected").attr("data-value");
                                         if(status!=null&&status!=""&&status!="undefine"){
                                         	sou += "&status="+status;
                                         }
                                         var createStartDate = $("#createStartDate").val();
                                         if (createStartDate!=null){
                                            sou += "&createStartDate="+createStartDate;
                                         }
                                         var validStartDate = $("#validStartDate").val();
                                         if (validStartDate!=null){
                                            sou += "&validStartDate="+validStartDate;
                                         }
                                         var useStartDate = $("#useStartDate").val();
                                         if (useStartDate!=null){
                                            sou += "&useStartDate="+useStartDate;
                                         }
                                         var useEndDate = $("#useEndDate").val();
                                         if (useEndDate!=null){
                                            sou += "&useEndDate="+useEndDate;
                                         }
                     					 
                                         if (sou!=""){
                                             location.href=url+sou;
                                         }
                                    }
                                    function exportxls(){
                                   	 	var sou = "";
                                   	 	var username = $("#username").val();
                                     	if (username!=null&&username!=""&&username!="undefine"&&username!="请输入用户名"){
                                        	sou += "&username="+username;
                                     	}
                                	 	var realname = $("#realname").val();
                					 	if(realname!=""&&realname!="请输入真实姓名"){
                							sou += "&realname="+realname;
                					 	}
                					 
                						var redPacketType = $("#redPacketType").find(".open-selected").attr("data-value");
                                     	if(redPacketType!=null&&redPacketType!=""&&redPacketType!="undefine"){
                                    		sou += "&redPacketType="+redPacketType;
                                     	} 
                                     	var status = $("#status").find(".open-selected").attr("data-value");
                                     	if(status!=null&&status!=""&&status!="undefine"){
                                    		sou += "&status="+status;
                                     	}
                                     	var createStartDate = $("#createStartDate").val();
                                     	if (createStartDate!=null){
                                       		sou += "&createStartDate="+createStartDate;
                                     	}
                                     	var validStartDate = $("#validStartDate").val();
                                     	if (validStartDate!=null){
                                       		sou += "&validStartDate="+validStartDate;
                                     	}
                                     	var useStartDate = $("#useStartDate").val();
                                     	if (useStartDate!=null){
                                       		sou += "&useStartDate="+useStartDate;
                                     	}
                                     	var useEndDate = $("#useEndDate").val();
                                     	if (useEndDate!=null){
                                       		sou += "&useEndDate="+useEndDate;
                                     	}
                                       	if (sou!=""){
                                           	location.href=xlsurl+sou;
                                       	}else{
                                           	location.href=xlsurl;
                                       	}
                                   }
                                </script>
                            </div>

            </div>
        </div>
        <div>
            <!--尾部--{-->
            <td colspan="3" class="mc-b"><#include "../foot.html"></td>
            <!--尾部--}-->
        </div>
    </div>

    </body>
</html>
<#include "../jsPage.html">
